package Get4;

use Moose;
use HTML::TreeBuilder;


has file => (is => 'rw', default => 'file.html');
has tree => (is => 'rw', lazy_build => 1);

has name => (
	     is => 'ro', 
	     lazy_build => 1,
	    );

has w => (
	     is => 'ro', 
	     lazy_build => 1,
	    );

sub _build_name {
    my($self)=@_;

    $self->tree->look_down(id => 'name');
}

sub _build_w {
    my($self)=@_;

    $self->tree->look_down(id => qr/w.lc.me/);
}

sub _build_tree {
    my($self)=@_;

    HTML::TreeBuilder->new_from_file($self->file);
}

1;

package main;

my $o = Get4->new;

warn $o->w->as_HTML;

1;
